package exception;

public class ThrowDemo {
    public static void main(String[] args) {
        System.out.println("程序开始了！");
        Person p = new Person();
        //p.setAge(16);

        try {
            p.setAge(1000);
        } catch (IllegalAgeException e) {
            throw new RuntimeException(e);
        }
        System.out.println("此人的年龄:"+p.getAge());
        System.out.println("程序结束了！");
    }
}
